home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / applets / collectn / assertab.jav < prev    next >
Encoding:
Text File  |  1995-10-14  |  1.0 KB  |  47 lines

  1. /*
  2.   File: Assertable.java
  3.  
  4.   Originally written by Doug Lea and released into the public domain. 
  5.   Thanks for the assistance and support of Sun Microsystems Labs, Agorics 
  6.   Inc, Loral, and everyone contributing, testing, and using this code.
  7.  
  8.   History:
  9.   Date     Who                What
  10.   13Oct95  dl@cs.oswego.edu  Created.
  11.  
  12. */
  13.  
  14. package collections;
  15.  
  16. /**
  17.  * Assertable is an interface for classes possessing
  18.  * an assert method that raises an exception if a boolean
  19.  * argument is false.
  20.  * <P>
  21.  * 
  22.  * @author Doug Lea
  23.  * @version 0.93
  24.  *
  25.  * <P> For an introduction to this package see <A HREF="index.html"> Overview </A>.
  26.  *
  27. **/
  28.  
  29. public interface Assertable {
  30.  
  31. /**
  32.  * Raise an exception if predicate is false.
  33.  * 
  34.  * Suggested default implementation is:
  35.  * <PRE>
  36.  * {
  37.  *  ImplementationError.assert(this, predicate);
  38.  * }
  39.  * </PRE>
  40.  * This method should either return normally or throw:
  41.  * @exception ImplementationError if predicate is false.
  42. **/
  43.  
  44.   public void assert(boolean predicate) throws ImplementationError; 
  45. }
  46.  
  47.